﻿<DemoContainer>
    <ApexChart TItem="Order"
               Title="Order Gross Value" Options="options">

        <ApexPointSeries TItem="Order"
                         Items="orders"
                         Name="Gross Value"
                         SeriesType="SeriesType.Donut"
                         XValue="@(e => e.Country)"
                         YAggregate="@(e => e.Sum(e => e.GrossValue))"
                         OrderByDescending="e=>e.Y" 
                         />
    </ApexChart>
</DemoContainer>

@code {
    private List<Order> orders  = SampleData.GetOrders();
    private ApexChartOptions<Order> options = new();
    protected override void OnInitialized()
    {
        options.PlotOptions = new PlotOptions { Pie = new PlotOptionsPie { StartAngle = -90, EndAngle = 90 } };
    }

    }